class Person:
    def __init__(self, name):
        self.name = name

    def __str__(self):
        return F'【__str__】Person对象：name={self.name}'

    # 小于
    def __lt__(self, other):
        return len(self.name) > len(other.name)

    # 小于等于
    def __le__(self, other):
        return len(self.name) == len(other.name)

    def __eq__(self, other):
        return self.name == other.name


p1 = Person('Jagochan')
print(p1)

p2 = Person('Jack')

print(p1 > p2)
print(p1 < p2)

print(p1 >= p2)
print(p1 <= p2)

# 默认比较的是内存地址
print(p1 == p2)
